<include file="header" />
<body>
<div class="wraper">
    <div class="top">
        <a href="{BEESCRM::U('base/slEle/index',array('ele_id'=>$ele_id))}" class="iconfont icon-zuo pull-left"></a>
        <span class="pull-left">电量查询</span>
        <a href="{BEESCRM::U('base/slEle/index',array('ele_id'=>$ele_id))}" class="iconfont icon-shouye pull-right text-right"></a>
    </div>
    <div class="margin-top">
        <p class="form-box">
            <select id="community">
                <option value="0">请选择所在校区</option>
	            <volist name="community" id="vo">
		            <option value="{BEESCRM:$vo.community_id}" data-num="{BEESCRM:$vo.community_code}" data-name="{BEESCRM:$vo.community_name}">{BEESCRM:$vo.community_name}</option>
	            </volist>
            </select>
            <span class="triangle"></span>
        </p>
	    <p class="form-box">
		    <select id="building">
			    <option value="0">请选择楼幢</option>
		    </select>
		    <span class="triangle"></span>
	    </p>
	    <p class="form-box">
		    <select id="floor">
			    <option value="0">请选择楼层</option>
		    </select>
		    <span class="triangle"></span>
	    </p>
	    <p class="form-box">
		    <select id="room">
			    <option value="0">请选择房间</option>
		    </select>
		    <span class="triangle"></span>
	    </p>
    </div>
    <div class="btn-box">
        <a href="javascript:void(0);" class="btn">立即查询</a>
    </div>
</div>
<include file="commonJS" />
<script src="/assets/base/common/ajaxgetroominfo.js"></script>
<script>
	$(function(){
		//调用房间联动js
		ajaxgetroominfo(true,true,true);
	});

    $('.tab-prize').on('click','.option',function(){
        if($(this).hasClass('other')){
            $(this).siblings().removeClass('checked');
        }
        else{
            $(this).toggleClass('checked').siblings().removeClass('checked');
        }
    })

	$('.btn').on('click',function(){
		var room_id = $('#room').val();
		var community_name = $("#community").find("option:selected").data('name');
		var building_name = $("#building").find("option:selected").data('name');
		var floor_name = $("#floor").find("option:selected").data('name');
		var room_name = $("#room").find("option:selected").data('name');

		if(room_id == 0){
			$.alert('error','请选择寝室');
			return false;
		}


		var str = "/room_id/"+room_id+"/room_name/"+room_name+"/community_name/"+community_name+"/building_name/"+building_name+"/floor_name/"+floor_name+"/flag/1";
		window.location.href="/base/slEle/queryResult/ele_id/{BEESCRM:$ele_id}"+str;
    });
</script>
</body>
</html>